<?
//关于会员vip等级
class classVip
{
	//$this->grade=0;					//会员等级
	//$this->depositAmount=1;			//押金
	//$this->maxFriendNum=20;			//最大好友数量
	//$this->adPrice=1;					//自助广告的折扣
	
	/** classVip 主方法
	* @param mem_id		会员id
	* @return Void
	*/
	function classVip($mem_id)
	{
		//初始化
		$this->depositAmount=1;				//押金折扣
		$this->maxFriendNum=20;				//最大好友数量
		$this->adPrice=1;					//自助广告的折扣
			
		global $db;
		$time=time();
		$sql="select grade from mem_vip where starttime<='$time' and endtime>='$time' and mem_id='$mem_id'";
		$rs=$db->Execute($sql);
		if($rs && $row=$rs->FetchRow())
		{
			$this->grade=$row['grade'];
			switch($this->grade)
			{
				case 1:		//金牌vip
					$this->depositAmount=0;				//押金折扣
					$this->maxFriendNum=500;			//最大好友数量
					$this->adPrice=0.5;					//自助广告的折扣
					break;
				case 2:		//银牌vip
					$this->depositAmount=0.5;			//押金折扣
					$this->maxFriendNum=100;			//最大好友数量
					$this->adPrice=0.5;					//自助广告的折扣
					break;
				case 3:		//铜牌vip
					$this->depositAmount=0.8;			//押金折扣
					$this->maxFriendNum=50;				//最大好友数量
					$this->adPrice=0.5;					//自助广告的折扣
					break;
				default:
					break;
			}
		}
	}
}
?>